<include file="public/header" title="单品搜索"  body=""/>
<include file="public/header_nav" title="单品搜索" href="javascript:history.back(-1);"/>
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<div class="p search_pl">
    <div class="maleri30">
        <div class="search2">
            <form method="post" action="{:U('mobile/Taobao/searchOne')}" id="sourch_form">
                <div class="search_input">

                    <textarea  name="q" id="q" placeholder="【我剁手都要买的宝贝（韩夫人杀菌机除螨仪家用床铺床上吸尘器除螨虫紫外线小型迷你除尘），快来和我一起瓜分红I包】，复制这条信息￥RcBH0tZTPmu￥后打开手淘" value="{$keyword}" class="keyword_input"></textarea>

               <div class="new_btn">
                   <a href="javascript:;" onclick="ajaxsecrch()" class="btn_submit">搜索</a>

                    <a href="javascript:;" onclick="reset()" class="btn_reset">清空</a>

               </div>
                </div>
            </form>
        </div>
    </div>
</div>

<div id="goods_info">


    <?php if($data['has']==1){ ?>
    <div class="banner ban1 detailban">
        <div class="mslide" id="slideTpshop">
            <ul>

                <li><a href="javascript:void(0)"><img src="{$data.good.pict_url}" alt=""></a></li>
                <!--图片-s-->
                <foreach name="$data.good.small_images.string" item="pic">
                    <li><a href="javascript:void(0)"><img src="{$pic}" alt=""></a></li>
                </foreach>
                <!--图片-e-->
            </ul>
        </div>
    </div>
    <div class="orderlistshpop p">





                        <div data-gid="8134418" class="title-wrapper clearfix">{$data.good.title} </div>
                        <div class="goods-jq clearfix">
                            <div class="goods-price fl">在售价<b><i>￥</i>{$data.good.zk_final_price}</b> </div>
                            <if condition="$data.good.sub_final_coupon_price eq ''">
                                <div class="goods-num fr"><i></i><b>{$data.good.volume}</b> 人已买</div>
                            </if>
                        </div>

                        <if condition="$data.good.sub_final_coupon_price neq ''">
                            <div class="goods-jq clearfix">
                                <div class="goods-price fl">券后价<b><i>￥</i>{$data.good.sub_final_coupon_price}</b> </div>
                                <div class="goods-quan shoufa-quan fl"><span>券</span><b><i>￥</i>{$data.good.coupon_price}</b></div>
                                <div class="goods-num fr"><i></i><b>{$data.good.volume}</b> 人已买</div>
                            </div>
                        </if>


    </div>

    <div class="buy-wrapper-new">


        <ul class="row-s">
            <li class="col-sm-4">
                <a href="javascript:;" id="copy">淘口令</a>

            </li>


            <li class="col-sm-6">
                <a href="{$data.good.uland_url}" class="buy-btn buy-btn-primary tb_app">领券购买 </a>
            </li>
        </ul>

</div>


    <div class="copy_content" style="display:none;" >

        <div class="buy-box-center">
            <div class="code-cent">
                <div class="cente-text"><div>
                    <p class="textarea" id="codeCopy">
                        【{$data.good.shop_title}】{$data.good.title}<br>
                        【原价】{$data.good.zk_final_price}元<br>【券后】{$data.good.sub_final_coupon_price}元<br>
                        【复制此信息打开手机淘宝即可查看并下单】{$data.good.tpwd_creat}
                        <br>
                    </p>
                </div>
                </div>
                <p class="text">长按文字区域手动复制淘口令</p>
                <a href="javascript:;" class="buy-btn-copy" data-clipboard-text="
 【{$data.good.shop_title}】{$data.good.title}
【原价】{$data.good.zk_final_price}元
【券后】{$data.good.sub_final_coupon_price}元
【复制此信息打开手机淘宝即可查看并下单】{$data.good.tpwd_creat}">一键复制</a></div></div>

    </div>
    <div style="display: block;height: 3rem;padding: .42667rem .64rem;"></div>
    <div class="plusshopcar-buy p" style="    position: fixed;    bottom: 0;    width: 100%;    left: 0; ">
        <a class="pb_plusshopcar button active_button dis_btn" href="javascript:;"  id="buy-text">分享</a>
        <?php if(is_weixin()){?>
        <a class="pb_buy dis_btn" href="javascript:;"  id="buy-text" >口令购买 </a>
        <?php }else{ ?>
        <a class="pb_buy dis_btn" href="{$data.good.uland_url}" >立即购买 </a>
        <?php }?>
    </div>
<?php } else {?>
<div class="orderlistshpop p">
    <div class="maleri30">
        当前商品没有查询到优惠券信息
    </div>
</div>
<?php }?>
</div>


<script>

    var clipboard = new ClipboardJS('.buy-btn-copy');
    function ajaxsecrch(){
        if($.trim($('#q').val()) != ''){
            $("#sourch_form").submit();
        }else{
            layer.open({content:'请输入搜索关键字',time:2});
        }
    }
    
    function  reset() {

        $('.keyword_input').val("");
    }


    $('#buy-text').on('click', function(){

        layer.open({
            type: 1,

            title: [
                '复制分享文案',
                '     background: linear-gradient(to right,#FD65EA,#FFBF63);color:#transparent;text-align:center;'

            ],

            shadeClose: true,
            area: ['80%', '60%'],
//            skin: 'layui-layer-rim', //加上边框
            content:$('.copy_content')
        });
    });

    $('.buy-btn-copy').on('click', function(){
            clipboard.on('success', function(e) {
                $('.buy-btn-copy').addClass("active");
                $('.buy-btn-copy').html('复制成功');
                layer.msg('复制成功');
            });
            clipboard.on('error', function(e) {
                console.log(e);
            });

        }

    )

</script>
</body>
</html>
